package com.android.kmlmrg.services.web;

import javax.mail.MessagingException;
import javax.mail.internet.AddressException;

import com.android.kmlmrg.utils.MailHelper;

import android.os.AsyncTask;

public class SendMailAsync extends AsyncTask<String, Integer, String> {
	
	private String subject;
	
	private String body;
	
	private String[] recipients;
	
	private  MailHelper mailHelper;
	public SendMailAsync(String pSubject, String pBody, String[] pRecipient){
		subject = pSubject;
		body = pBody;
		recipients = pRecipient;
	}
	@Override
	protected String doInBackground(String... params) {
		 mailHelper = MailHelper.getInstance();
			
			try {
				mailHelper.send(subject,body,recipients);
			} catch (AddressException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (MessagingException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			} catch (Exception e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		return null;
	}

}
